In automated manufacturing, it is often important to determine the location, shape, size, and/or angular orientation of an object being processed or assembled. The definition of "object" depends on the task at hand. For example, for inspecting the presence/absence/quality of adhesive being printed on a printed circuit board, adhesive is the "object". For inspecting the presence/absence/quality of solder paste on a printed circuit board, solder paste is the "object". In general, an "object" is defined herein as a feature of interest, and everything else is called the "background".
Although a human eye can readily distinguish between objects in an image, this has not historically been the case for machine vision systems. In the field of machine vision, the task of analyzing an image to isolate and identify the features of interest is a process referred to as "segmentation". In the example of "adhesive inspection" on a printed circuit board, image segmentation can be employed to identify the pixels in the image that represent regions of adhesive, i.e., "object" regions, as well as those pixels that represent all other features (printed circuit board, traces, pads, ground planes, etc.) i.e., "background" regions. By assigning different pixel values to object and background regions, respectively, such as "1" to pixels that represent object regions and "0", to pixels that represent background regions, image segmentation can facilitate subsequent analysis of the image by other machine vision tools, such as "connectivity analysis". Connectivity analysis can be employed to isolate the objects in a segmented image by identifying their component pixels, particularly, by identifying those object pixels that are connected to each other by virtue of horizontal, vertical, or diagonal adjacency.
The prior-art includes a number of techniques for segmenting an image. For example, "thresholding" can be used to distinguish an object from the background by classification of pixel gray-values in an image of the object. In the example above, thresholding can be used to segment object from background by finding an appropriate gray-value that distinguishes each pixel of the object from each pixel of the background. Other more complex thresholding techniques are required for images that cannot be segmented using a single static threshold.
A threshold value can be static (i.e., fixed) if, for all images of the parts being inspected, the object gray-values are distinguishable from the background gray-values (i.e., there is no single gray-value that is associated with both an object region and a background region). However, if this condition is not satisfied, then a dynamic/adaptive thresholding technique is required. Typically, these techniques are histogram-based.
A gray-value histogram of an image is a function that gives the number of pixels of each gray-value in the image. If the gray-values v are quantized from 0 to n, then the histogram value at a particular gray-value v (between 0 and n) is denoted by h(v), for example.
In a simple adaptive thresholding scheme, called "relative mapping", the threshold corresponds to the gray-value below which the gray-value of a certain fixed percentage of pixels fall, where the fixed percentage of pixels corresponds to a fixed area under the histogram curve. More complex adaptive thresholding techniques could be constructed, for example, by assuming that the histogram is bi-modal (i.e., has two peaks), and therefore finding a suitable threshold is straightforward once the predominant gray-value of each peak is found. The dynamic threshold can be placed at the half-way point between the two peaks, or at a minimum point between the two peaks.
Although the adaptive segmentation techniques described above are useful in isolating objects in the context of a simple background, they are of limited value in identifying objects surrounded by complex backgrounds. This situation typically arises in the case of segmenting images to detect the presence/absence of adhesive on a printed circuit board, and in the case of segmenting images to perform defect detection on the surface of a semi-conductor die, for example. It must be noted that presence/absence determination and defect detection is an inherent result of a segmentation analysis. This can be understood by recognizing that if the object is absent, or if there are no defects, segmentation should reveal no objects and only background. Otherwise, segmentation should reveal the feature of interest or the defects in the image as, for example, a cluster of 1's against a background of 0's.
It is known to use golden template comparison (GTC) to aid in segmenting complicated images such as images of objects having a complex background. GTC is a technique for locating defects by comparing a test image of a feature under scrutiny to a good image called a "golden template. Before a GTC inspection can be performed, a golden template must be trained and stored in memory. Further, to compare the test image with the golden template, the test image must be precisely registered with respect to the golden template. In some applications, it can be overly burdensome to perform the training step necessary to obtain a golden template, and to ensure that precise registration is achieved. Moreover, the GTC technique is useful primarily in applications where the production process under analysis is very repeatable. However, in the case of some applications, conditions can vary, such as in the case of adhesive inspection on printed circuit boards, wherein board color varies, adhesive color varies, and other features such as pads, masks, and traces may not have the exact same size from board to board, thereby making GTC difficult to use.
Another technique that can be used for adhesive inspection is to capture two images and compare them: one image taken before the adhesive is applied, and one image taken after the adhesive is applied. This technique eliminates some of the problems that are encountered with GTC, explained above. However, capturing two images at different times increases the cycle time of the inspection, while also complicating mechanical handling of the object under inspection. Also, the problem of registration still needs to solved, where here the two images to be compared must be precisely registered with respect to each other.